Skip to content

Add Aspire integration tests, container smoke test, and rename endpoints to _microstack - #10

Merged
damianh merged 11 commits into
mainfrom
dh/aspire-integration-tests
Apr 22, 2026
Merged

Add Aspire integration tests, container smoke test, and rename endpoints to _microstack#10
damianh merged 11 commits into
mainfrom
dh/aspire-integration-tests

Conversation

@damianh

@damianh damianh commented Apr 22, 2026

Copy link
Copy Markdown
Owner

Summary

Adds two new test suites and renames all internal API endpoints from _ministack to _microstack to align with the project rename.

Aspire integration tests — 5 smoke tests using DistributedApplicationTestingBuilder that verify connection string injection, health endpoint, and basic S3/SQS/SNS operations against a real MicroStack instance.

Container smoke test — publishes a native AOT binary via WSL, builds a Docker image (debian-slim), starts the container, and verifies the health endpoint responds 200 OK with the expected payload. This caught and fixed a real bug: Results.Ok() in minimal APIs was missing the source-generated JSON context, causing 500 errors under native AOT.

Also migrates all test projects from xunit v2 to xunit v3 (MTP runner).

Reviewer focus

  • src/MicroStack/Program.csConfigureHttpJsonOptions registration (native AOT fix)
  • tests/MicroStack.Tests/ContainerSmokeTests.cs — WSL-based container build/test approach
  • tests/MicroStack.Aspire.Tests/ — Aspire test structure and smoke test coverage
  • Endpoint rename _ministack_microstack across ~60 files

Risk / impact

  • Breaking: All internal API paths changed from /_ministack/* to /_microstack/*. Any external tooling or scripts hitting these endpoints will need updating.
  • The container smoke test requires WSL with .NET SDK installed — it will skip/fail in CI environments without WSL.
  • xunit v3 migration changes IAsyncLifetime from Task to ValueTask return types.

damianh added 11 commits April 22, 2026 14:23
- Add OutputType Exe to both test csproj files (required by xunit v3)
- Change IAsyncLifetime methods from Task to ValueTask (42 test files)
- Replace Task.CompletedTask with ValueTask.CompletedTask in DisposeAsync
- Replace Assert.SkipUnless with conditional TestContext.Current.CancelCurrentTest() in LambdaTests
Introduces AppHost project with AddMicroStack and a test project with 5 smoke
tests verifying connection string, health endpoint, and basic S3/SQS/SNS
operations via DistributedApplicationTestingBuilder.
Aligns internal API paths (health, reset, config, lambda-layers) with the
project rename from MiniStack to MicroStack.
Remove unused using directives flagged by AOT trimming analysis.
Add TestingPlatformDotnetTestSupport and OutputType Exe for xunit v3 MTP.
Publishes native AOT binary via WSL, builds Docker image with debian-slim,
starts the container, and verifies health endpoint responds with 200 OK.

Fixes: register MicroStackJsonContext with ConfigureHttpJsonOptions so
Results.Ok() works under native AOT (source-generated serialization).
Also adds docker.io/ prefix to ContainerBaseImage to suppress CONTAINER2020.
Replace VSTest --logger flag with MTP --report-trx to fix test execution
on .NET 10 SDK where VSTest is no longer supported.
The .NET 10 SDK requires global.json test runner config instead of the
TestingPlatformDotnetTestSupport MSBuild property. Update dotnet test
command to use the new MTP-native syntax.
Use global.json MTP runner config. Exclude ContainerSmokeTests which
requires WSL. Remove TRX reporting (not needed for xunit v3 MTP).
The Aspire tests launch MicroStack as a hosted process which requires
a running instance. These are intended for local development only.
@damianh
damianh merged commit 3d1e4ee into main Apr 22, 2026
1 check passed
@damianh
damianh deleted the dh/aspire-integration-tests branch April 23, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant